<template>
  <div class="home" >
    <el-container>
      <el-header style="height: auto">
        <home-header/>
      </el-header>
      <el-container>
        <ul class="homeModel">
          <li v-for="item in models" :key="item.id" @click="toMainPage(item)">
            {{ item.name }}
          </li>
        </ul>
      </el-container>
    </el-container>
  </div>
</template>

<script>
//头部组件
import HomeHeader from "@/views/home/compoents/HomeHeader";

export default {
  name: "index",
  components: {HomeHeader},
  data() {
    return {
      //api
      api: this.$store.getters.app.api,

      //全局加载
      homeLoading: false,
      //模块集合
      models: this.$store.getters.app.routes
    }
  },
  async mounted() {
  },
  methods: {
    toMainPage(item){
      //console.log(item,"item")
      this.$router.push(item.children[0].path)
    }
  }
}
</script>

<style scoped>
* {
  padding: 0;
  margin: 0;
}

.home {
  width: 100%;
  height: 100%;
  position: relative;
}

.homeModel {
  width: 100%;
  height: 100%;
}

.homeModel li {
  width: 300px;
  height: 300px;
  text-align: center;
  line-height: 300px;
  background: #2a2d30bf;
  border-radius: 150px;
  margin: 10px;
  list-style: none;
  float: left;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
}

.homeModel li:hover {
  background: #2a2d30f0;
}

.el-aside {
  height: 100%;
}

.el-menu {
  height: 100%;
}

.el-container {
  width: 100%;
  height: 100%;
}
</style>